<!--
  @author duanzuocai
  @since 2018/10/23 15:12
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        渠道管理>
        <a lay-href="/channel/list.action">渠道管理</a>>
        <a th:href="'/channel/detail.action?channelId='+${channel.channelId}">[[${channel.name}]]</a>>
        <a th:href="'/channel/promotion/list.action?channelId='+${channel.channelId}" th:text="今日头条推广">今日头条推广</a>>
        <zmn th:text="${obj.relateId > 0 ? '修改头条账号' : '新增头条账号'}">新增/修改头条账号</zmn>
    </blockquote>

    <div class="layui-card">

        <div class="layui-card-body">

            <!--表单样式统一为layui-form(必需样式)，lay-filter属性统一定义为zmn-form-->
            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="channelId" th:value="${obj.channelId}"/>
                <input type="hidden" name="relateId" th:value="${obj.relateId}"/>

                <div class="layui-card-header layui-margin-b"><b>基本信息</b></div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">公司名称：</label>
                    <div class="layui-input-inline" style="width: 430px">
                        <input type="text" lay-verify="required" name="companyName" th:value="${obj.companyName}" autocomplete="off" class="layui-input" maxlength="200"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">账户ID：</label>
                    <div class="layui-input-inline" style="width: 430px">
                        <input type="text" lay-verify="required" name="accountId" th:value="${obj.accountId}" autocomplete="off" class="layui-input" maxlength="200"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">账户名称：</label>
                    <div class="layui-input-inline" style="width: 430px">
                        <input type="text" lay-verify="required" name="accountName" th:value="${obj.accountName}" autocomplete="off" class="layui-input" maxlength="200"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">密钥：</label>
                    <div class="layui-input-inline" style="width: 430px">
                        <input type="text" lay-verify="required" th:class="${obj.secretKey != null && obj.secretKey != '' ? 'layui-input layui-disabled' : 'layui-input'}" th:disabled="${obj.secretKey != null && obj.secretKey != ''}" name="secretKey" th:value="${obj.secretKey}" autocomplete="off" maxlength="200"/>
                    </div>
                    <div class="layui-input-inline" style="width:160px;">
                        <label class="layui-form-mid" style="color: red;">填写后不可以修改</label>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">token：</label>
                    <div class="layui-input-inline" style="width: 430px">
                        <input type="text" lay-verify="required" th:class="${obj.token != null && obj.token != '' ? 'layui-input layui-disabled' : 'layui-input'}" th:disabled="${obj.token != null && obj.token != ''}" name="token" th:value="${obj.token}" autocomplete="off" maxlength="200"/>
                    </div>
                    <div class="layui-input-inline" style="width:160px;">
                        <label class="layui-form-mid" style="color: red;">填写后不可以修改</label>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">落地页链接：</label>
                    <div class="layui-input-inline" style="width: 430px">
                        <input type="text" lay-verify="required" name="landingPageLink" th:value="${obj.landingPageLink}" autocomplete="off" class="layui-input" maxlength="200"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">状态：</label>
                    <div class="layui-input-inline" style="width:300px">
                        <input type="radio" name="status" value="2"
                               th:checked="${obj.status == null || obj.status == 2}" title="是" lay-verify="required">
                        <input type="radio" name="status" value="1"
                               th:checked="${obj.status == 1}" title="否" lay-verify="required">
                    </div>
                </div>

                <zmn th:if="${obj.relateId > 0}">
                    <div class="layui-card-header layui-margin-b"><b>其他信息</b></div>

                    <div class="layui-form-item layui-form-item-sm">
                        <label class="layui-form-label">修改人/时间：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid layui-word-aux" th:text="${obj.updater} + '&nbsp;/&nbsp;' + ${#dates.format(obj.updateTime, 'yyyy-MM-dd HH:mm:ss')}">修改人/时间</div>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-item-sm">
                        <label class="layui-form-label">创建人/时间：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid layui-word-aux" th:text="${obj.creater} + '&nbsp;/&nbsp;' + ${#dates.format(obj.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建人/时间</div>
                        </div>
                    </div>
                </zmn>

                <!--按钮栏
                    置于form标签内的最下方，
                    主功能按钮使用默认样式，次要功能按钮使用原始按钮(加入样式layui-btn-primary)
                    -->
                <div class="layui-form-item submit">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">提交</button>
                        <button onclick="parent.layui.element.tabDelete('layadmin-layout-tabs', window.location.pathname + window.location.search)" class="layui-btn layui-btn-primary" id="cancel">取消</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        channel_promotion_edit: "channel/promotion/zmn.plat.channel.promotion.edit",
    }).use(['index', 'channel_promotion_edit']);

</script>